﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Runtime.CompilerServices;
using UnityEngine;

public class AnimateHover : MonoBehaviour
{
    public float ceil = 1f;
    public float floor;

    [DebuggerHidden]
    private IEnumerator _Play()
    {
        return new <_Play>c__Iterator13 { <>f__this = this };
    }

    private void Awake()
    {
        this.Play();
    }

    private void OnDisable()
    {
        base.StopAllCoroutines();
    }

    public void Play()
    {
        if (base.isActiveAndEnabled)
        {
            this.Stop();
            base.StartCoroutine(this._Play());
        }
    }

    private void SetPos(Vector3 pos)
    {
        base.transform.localPosition = pos;
    }

    public void Stop()
    {
        base.StopAllCoroutines();
    }

    [CompilerGenerated]
    private sealed class <_Play>c__Iterator13 : IDisposable, IEnumerator, IEnumerator<object>
    {
        internal object $current;
        internal int $PC;
        internal AnimateHover <>f__this;

        internal void <>m__13C(Vector3 p)
        {
            this.<>f__this.SetPos(p);
        }

        internal void <>m__13D(Vector3 p)
        {
            this.<>f__this.SetPos(p);
        }

        [DebuggerHidden]
        public void Dispose()
        {
            this.$PC = -1;
        }

        public bool MoveNext()
        {
            uint num = (uint) this.$PC;
            this.$PC = -1;
            switch (num)
            {
                case 0:
                case 2:
                    this.$current = this.<>f__this.StartAnimateVector3((Vector3) (Vector3.up * this.<>f__this.floor), (Vector3) (Vector3.up * this.<>f__this.ceil), 1f, AnimationCurve.EaseInOut(0f, 0f, 1f, 1f), new Action<Vector3>(this.<>m__13C), null);
                    this.$PC = 1;
                    goto Label_0117;

                case 1:
                    this.$current = this.<>f__this.StartAnimateVector3((Vector3) (Vector3.up * this.<>f__this.ceil), (Vector3) (Vector3.up * this.<>f__this.floor), 1f, AnimationCurve.EaseInOut(0f, 0f, 1f, 1f), new Action<Vector3>(this.<>m__13D), null);
                    this.$PC = 2;
                    goto Label_0117;

                default:
                    break;
                    this.$PC = -1;
                    break;
            }
            return false;
        Label_0117:
            return true;
        }

        [DebuggerHidden]
        public void Reset()
        {
            throw new NotSupportedException();
        }

        object IEnumerator<object>.Current
        {
            [DebuggerHidden]
            get
            {
                return this.$current;
            }
        }

        object IEnumerator.Current
        {
            [DebuggerHidden]
            get
            {
                return this.$current;
            }
        }
    }
}

